Is there any difference (internal or practical) in using $this->request->getPost() and $form->request->getPost() in regards to filtering and sanitizing data coming from a form?
Example code:
$form = new LoginForm();
if ($this->request->isPost()) {
if ($form->isValid($this->request->getPost())) {
// And here comes the line I am asking the question about
$this->getDI()->get('auth')->formLogin($form->request->getPost());
$this->flashSession->success('Login successful!');
// bla bla
}
}
// OR this
$form = new LoginForm();
if ($this->request->isPost()) {
if ($form->isValid($this->request->getPost())) {
/// And here comes the line I am asking the question about
$this->getDI()->get('auth')->formLogin($this->request->getPost());
$this->flashSession->success('Login successful!');
// bla bla
}
}